function showTime() {
    var now = new Date();
    var nowTime = now.toLocaleString();
    var date = nowTime.substring(0,10);//截取日期
    var time = nowTime.substring(10,16); //截取时间
    var week = now.getDay(); //星期
    var hour = now.getHours(); //小时
    //判断星期几
    var weeks = ["日","一","二","三","四","五","六"];
    var getWeek = "星期" + weeks[week];
    var sc;
    //判断是AM or PM
    if(hour >= 0 && hour < 5){
        sc = '凌晨';
    }
    else if(hour > 5 && hour <= 7){
        sc = '早上';
    }
    else if(hour > 7 && hour <= 11){
        sc = '上午';
    }
    else if(hour > 11 && hour <= 13){
        sc = '中午';
    }
    else if(hour> 13 && hour <= 18){
        sc = '下午';
    }
    else if(hour > 18 && hour <= 23){
        sc = '晚上';
    }
    return  date+" " + getWeek +" "+"   "+sc+"  "+time;
}

function lazyImgSrc(options) {
    //alert(0)
    var opt = $.extend(options, {
        lazyAttr: "lazy-src",
        lazyAttrBGI: "lazy-url",
        baseURL: true
    });
    var preloadTimer = null;
    var targetIMG = $("[" + opt.lazyAttr + "]");
    var targetTAG = $("[" + opt.lazyAttrBGI + "]");
    var mergerTag = targetIMG.add(targetTAG);
    var baseURL = "";
    mergerTag.each(function (el_index, el_element) {

        var $el = $(el_element);
        var $img = $("<img>");

        preloadTimer = setTimeout(function () {
            $img[0].src = $el.attr(opt.lazyAttr) || $el.attr(opt.lazyAttrBGI);
            //console.log($img[0].src = $el.attr(opt.lazyAttr) || $el.attr(opt.lazyAttrBGI));
        }, (1 * parseInt(el_index)));

        if ($el[0].tagName.toLocaleLowerCase() == 'img') {
            $el.attr('src', baseURL);
        } else {
            $el.css({
                backgroundImage: "url(" + baseURL + ")"
            });
        }

        $img.on("load", function () {
            if ($el[0].tagName.toLocaleLowerCase() == 'img') {
                $el.attr('src', $img.attr("src"));
            } else {
                $el.css({
                    backgroundImage: "url(" + $img.attr("src") + ")"
                });
            }
            $el.removeAttr(opt.lazyAttr);
            $el.removeAttr(opt.lazyAttrBGI);
            $img = null;
        });

    });
    mergerTag = null;
}

//所有页面悚加载
!(function () {
    $(function () {
        lazyImgSrc();
        (function ($) {
            $(".wiget-kefu").on('click','a',function(){
                var qq=$(this).data('qq'),
                    url="http://wpa.qq.com/msgrd?v=3&uin="+qq+"&site=qq&menu=yes";
                var post={
                    qq:qq,
                    host:window.location.origin
                };
                $.post('/api/consult',post).then(function (data) {

                });
                window.open(url);
            })
        })(jQuery)
    })
})();